#include "../io/datalistener.h"
#include "../io/serverconnection.h"
#include "../io/connection.h"
#include <iostream>

using namespace std;

class CEchoListener : public greenhills::io::IDataListener
{
public:
    CEchoListener()
    {
    }

    virtual ~CEchoListener()
    {
    }

public:
    void dataReceived(const char *pData,
                      unsigned int pLength,
                      greenhills::io::CConnection *pConnection)
    {
        cout << "data received" << endl;

        pConnection->sendMessage(pData, sizeof(pLength));
	cout << "echo sent" << endl;
    }

};
